@inkeep/open-knowledge 0.63.0-beta.14 → 0.63.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +1 -1
  2. package/dist/{acp-harness-probe-DRbySBVr.mjs → acp-harness-probe-ClLen5mV.mjs} +2 -2
  3. package/dist/assets/skills/discovery/SKILL.md +12 -3
  4. package/dist/assets/skills/project/references/preview.md +1 -0
  5. package/dist/cli.d.mts +1 -7
  6. package/dist/cli.mjs +63 -61
  7. package/dist/constants--Mefqd_Y.mjs +2 -0
  8. package/dist/{git-handle-NTLKBuxQ.mjs → git-handle-B-wIq9_v.mjs} +2 -2
  9. package/dist/git-handle-Die2olDM.mjs +1 -0
  10. package/dist/index.d.mts +17 -1
  11. package/dist/index.mjs +184 -184
  12. package/dist/{init-44bY7bDu.mjs → init-DTAgv3R5.mjs} +34 -34
  13. package/dist/init-mgIG_U9p.mjs +1 -0
  14. package/dist/{launch-json-removal-NGM0vd0O.mjs → launch-json-removal-CdUHSdLM.mjs} +2 -2
  15. package/dist/{loader-Bqy2LPc4.mjs → loader-CX9-nOcJ.mjs} +2 -2
  16. package/dist/loader-CtQdAM2a.mjs +1 -0
  17. package/dist/md-manager-B5SZ3ICb.mjs +2 -0
  18. package/dist/{open-browser-CTBKeB6u.mjs → open-browser-BR2Im42W.mjs} +2 -2
  19. package/dist/parse-worker.mjs +1 -1
  20. package/dist/{preview-CBcNW71i.mjs → preview-Be1nfx_a.mjs} +2 -2
  21. package/dist/preview-CxQ9YhvK.mjs +1 -0
  22. package/dist/public/assets/{ActivityModeContent-DpSXlSDK.js → ActivityModeContent-CHILMZNT.js} +1 -1
  23. package/dist/public/assets/{AddPropertiesButton-D4JAaZQQ.js → AddPropertiesButton-N2hquuuJ.js} +1 -1
  24. package/dist/public/assets/{AgentDiffPane-CyDxOvCL.js → AgentDiffPane-DZIVlX7T.js} +1 -1
  25. package/dist/public/assets/{AgentThreadClientBinder-0PMIVX8t.js → AgentThreadClientBinder-D-WSZFly.js} +1 -1
  26. package/dist/public/assets/{BugReportHistory-C0wa0XGQ.js → BugReportHistory-Do8Akfia.js} +1 -1
  27. package/dist/public/assets/{BugReportHistoryDialog-DHqxk14p.js → BugReportHistoryDialog-CUVvL_V_.js} +1 -1
  28. package/dist/public/assets/{CodeMirrorPropInput-DruAtwJ7.js → CodeMirrorPropInput-BonPS-HY.js} +2 -2
  29. package/dist/public/assets/DocumentContext-CHklKdJU.js +38 -0
  30. package/dist/public/assets/{EditorModeToggle-bhfSOn_q.js → EditorModeToggle-ry71w-tr.js} +1 -1
  31. package/dist/public/assets/{EnableSyncConfirmDialog-B6yilqtJ.js → EnableSyncConfirmDialog-MNxsnx25.js} +1 -1
  32. package/dist/public/assets/{ExcalidrawDocEditor-CHNZnMVl.js → ExcalidrawDocEditor-B60Bbxuj.js} +1 -1
  33. package/dist/public/assets/FeedbackForm-Bg4JztCb.js +1 -0
  34. package/dist/public/assets/{GraphPanel-BUCcv-kh.js → GraphPanel-Doc3UkYk.js} +1 -1
  35. package/dist/public/assets/{ImportSkillDialog-BpdACb4T.js → ImportSkillDialog-CJDNe4Hm.js} +1 -1
  36. package/dist/public/assets/{LintConfigEditor-Bjo--Jlu.js → LintConfigEditor-C7bY5Vg9.js} +1 -1
  37. package/dist/public/assets/{ManagedArtifactProperties-CAjO5kPP.js → ManagedArtifactProperties-Bjd-HmPr.js} +1 -1
  38. package/dist/public/assets/ManagedArtifactProperties-Bq1W2pn6.js +1 -0
  39. package/dist/public/assets/{MermaidDocEditor-sVFVDRu0.js → MermaidDocEditor-98PHlD5d.js} +1 -1
  40. package/dist/public/assets/{PropertyDisplayRow-Zs1Dojtm.js → PropertyDisplayRow-gpEd0kfb.js} +1 -1
  41. package/dist/public/assets/{ReportBugDialogBody-IBysJpfl.js → ReportBugDialogBody-BAu2r8QZ.js} +1 -1
  42. package/dist/public/assets/{SchemaConfigEditor-DRO7Pk3U.js → SchemaConfigEditor-vjVfM5Sj.js} +1 -1
  43. package/dist/public/assets/SessionsHost-cu-i_Py-.js +2 -0
  44. package/dist/public/assets/{SettingsDialogBody-BMGAvrlE.js → SettingsDialogBody-CO2rU2Ts.js} +1 -1
  45. package/dist/public/assets/{ShareBranchSwitchDialog-AhlfSSFn.js → ShareBranchSwitchDialog-DYyy9FZ6.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-CtBx5On-.js → ShareReceiveDialog-Bf8y_Djr.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-DLEnh_5D.js → ShareReceiveMissDialog-2dn8BUR-.js} +1 -1
  48. package/dist/public/assets/{SkillCostValue-CvzNMqXu.js → SkillCostValue-DdoKihcJ.js} +1 -1
  49. package/dist/public/assets/{SkillEditBanner-tXNHuYvo.js → SkillEditBanner-B5Rhz1sK.js} +1 -1
  50. package/dist/public/assets/{SkillInstallMenu-BIQ8kFyt.js → SkillInstallMenu-BbGLFnIp.js} +1 -1
  51. package/dist/public/assets/{SkillOriginInline-o3OTyjM5.js → SkillOriginInline-BLqb-Q9f.js} +1 -1
  52. package/dist/public/assets/{SkillToolbarControls-NfRRvRVu.js → SkillToolbarControls-DuseqJHs.js} +1 -1
  53. package/dist/public/assets/{SlidesToolbarControls-3EMlFJ8t.js → SlidesToolbarControls-HDhusqiO.js} +1 -1
  54. package/dist/public/assets/{SourceEditor-D2uTTlMz.js → SourceEditor-Clg6eI_3.js} +1 -1
  55. package/dist/public/assets/{TerminalPanel-BCA5YFGB.js → TerminalPanel-CLna_vO1.js} +1 -1
  56. package/dist/public/assets/{TerminalWindowApp-C7BK93wZ.js → TerminalWindowApp-gPY6AEoz.js} +1 -1
  57. package/dist/public/assets/{TextDocEditor-Cv822TBa.js → TextDocEditor-CklZnKak.js} +1 -1
  58. package/dist/public/assets/{ThreadView-BrcLsj4M.js → ThreadView-Cx7IoasQ.js} +4 -4
  59. package/dist/public/assets/{TimelineDiffPane-COkWCc-p.js → TimelineDiffPane-6_BmgW-q.js} +1 -1
  60. package/dist/public/assets/{agent-diff-store-BzoWerAN.js → agent-diff-store-BQ63ociD.js} +1 -1
  61. package/dist/public/assets/{auth-state-cache-BY_HBQxD.js → auth-state-cache-BoEHhg1J.js} +1 -1
  62. package/dist/public/assets/{bug-report-send-manager-D8S8BM9G.js → bug-report-send-manager-i5VL8tcj.js} +1 -1
  63. package/dist/public/assets/{client-version-DgFD9pEA.js → client-version-B5-HmGfc.js} +1 -1
  64. package/dist/public/assets/{comment-chips-ENEVohZ7.js → comment-chips-BJp4Z6gM.js} +1 -1
  65. package/dist/public/assets/{config-provider-dIusLQHf.js → config-provider-EruTjtaU.js} +1 -1
  66. package/dist/public/assets/{dist-ClHGFbjP2.js → dist-CnzPyMX52.js} +1 -1
  67. package/dist/public/assets/{doc-paths-DAr9Ew0q.js → doc-paths-BRPkH6xf.js} +1 -1
  68. package/dist/public/assets/{documents-events-BYjMJCtr.js → documents-events-CCQgw0nj.js} +1 -1
  69. package/dist/public/assets/{file-tree-adapter-DsXEGhjb.js → file-tree-adapter-CUCkGST6.js} +1 -1
  70. package/dist/public/assets/{file-tree-utils-B2Axpvgc.js → file-tree-utils-rWtfRJr1.js} +1 -1
  71. package/dist/public/assets/{folder-config-api-yRQlw6u0.js → folder-config-api-lyyhTvfi.js} +1 -1
  72. package/dist/public/assets/globals-Br_tCgC1.css +1 -0
  73. package/dist/public/assets/i18n-B6VtcWE-.js +1 -0
  74. package/dist/public/assets/index-71h2S3L-.js +2196 -0
  75. package/dist/public/assets/{lint-config-client-CvBLe774.js → lint-config-client-CUY7G3d1.js} +1 -1
  76. package/dist/public/assets/{markdownlint-rule-browser-DPzJ-2Lh.js → markdownlint-rule-browser-Dz_YV4nb.js} +1 -1
  77. package/dist/public/assets/page-list-cache-B3hpCgnI.js +1 -0
  78. package/dist/public/assets/{pending-receive-nav-store-DWJKoDM1.js → pending-receive-nav-store-GeyTv6vL.js} +1 -1
  79. package/dist/public/assets/{progress-BpDlLX4d.js → progress-COZ-vSR3.js} +1 -1
  80. package/dist/public/assets/{prop-types-CNBRspY6.js → prop-types-B_H9lOE2.js} +1 -1
  81. package/dist/public/assets/{receive-store-B9Ct8-SS.js → receive-store-C2e1W-CK.js} +1 -1
  82. package/dist/public/assets/{selection-context-vyl25V2m.js → selection-context-ExCMrk51.js} +1 -1
  83. package/dist/public/assets/{skill-scope-2ZCES3JH.js → skill-scope-mDqM7wzc.js} +1 -1
  84. package/dist/public/assets/{skills-api--ee5EeEm.js → skills-api-PeIbMIpS.js} +1 -1
  85. package/dist/public/assets/{src-CXCKDhky.js → src-DoJGoHbH.js} +1 -1
  86. package/dist/public/assets/{tag-pill-input-BNoYWhVX.js → tag-pill-input-DGdY4F_y.js} +1 -1
  87. package/dist/public/assets/{target-navigation-intent-DHP7_t_c.js → target-navigation-intent-BAfh4f5r.js} +1 -1
  88. package/dist/public/assets/{terminal-cli-display-BocYbbO4.js → terminal-cli-display-B9RLqrD0.js} +1 -1
  89. package/dist/public/assets/{terminal-launch-events-CAYVVL7j.js → terminal-launch-events-T1RxH2D_.js} +1 -1
  90. package/dist/public/assets/{terminal-telemetry-DVozpHQ9.js → terminal-telemetry-2xaVQF-W.js} +1 -1
  91. package/dist/public/assets/thread-client-Dd5imB2t.js +1 -0
  92. package/dist/public/assets/{typing-burst-detector-Dr0Uop8d.js → typing-burst-detector-4uDZY4-2.js} +1 -1
  93. package/dist/public/assets/{uninstall-CXQd-im6.js → uninstall-DwDCHx8s.js} +1 -1
  94. package/dist/public/assets/{use-activity-panel-GiVhJhnJ.js → use-activity-panel-cGCIgDHR.js} +1 -1
  95. package/dist/public/assets/{use-apply-config-color-theme-CFCI2GNF.js → use-apply-config-color-theme-Ds1FD3HK.js} +1 -1
  96. package/dist/public/assets/{use-collab-url-DEYfnaMS.js → use-collab-url-Cy83Ius9.js} +1 -1
  97. package/dist/public/assets/{use-live-xterm-theme-BFOnU-eC.js → use-live-xterm-theme-DaoAg9zj.js} +1 -1
  98. package/dist/public/assets/{use-open-skill-D21lvadY.js → use-open-skill-BJdJacrt.js} +1 -1
  99. package/dist/public/assets/{use-settings-route-BoEnTMeF.js → use-settings-route-CJVQDwmj.js} +1 -1
  100. package/dist/public/assets/{use-skill-origin-DDhmkGv4.js → use-skill-origin-BSotwjrK.js} +1 -1
  101. package/dist/public/assets/{use-skills-D4lRvSJa.js → use-skills-C787R0nA.js} +1 -1
  102. package/dist/public/assets/{use-terminal-enabled-CTRJVZCQ.js → use-terminal-enabled-CGA4TB6i.js} +1 -1
  103. package/dist/public/assets/{use-timeline-entry-diff-uDSMtgCJ.js → use-timeline-entry-diff-C9r_zVID.js} +1 -1
  104. package/dist/public/assets/{use-workspace-BuMImy8_.js → use-workspace-rmOBMRnx.js} +1 -1
  105. package/dist/public/index.html +47 -47
  106. package/dist/public/uninstall.html +5 -5
  107. package/dist/{repair-launch-json-pD-V682S.mjs → repair-launch-json-FhJ1-gFe.mjs} +2 -2
  108. package/dist/{repair-mcp-configs-BztWuczT.mjs → repair-mcp-configs-CVOPExvD.mjs} +2 -2
  109. package/dist/repair-skills-BAuMFgEP.mjs +1 -0
  110. package/dist/{repair-skills-DD0pO9KG.mjs → repair-skills-Bc9E4eeA.mjs} +2 -2
  111. package/dist/{resolve-project-root-BmEYZjtQ.mjs → resolve-project-root-C8lkeQRG.mjs} +3 -3
  112. package/dist/server-lock-6JxF9TCZ.mjs +1 -0
  113. package/dist/{server-lock-_XWgcmNh.mjs → server-lock-D3VEPV5W.mjs} +2 -2
  114. package/dist/{skill-teardown-DJadYmS9.mjs → skill-teardown-CrI8hOjf.mjs} +2 -2
  115. package/dist/src-BYHpzYVs.mjs +1 -0
  116. package/dist/src-BjxleI-A.mjs +20 -0
  117. package/dist/{src-DifwZnFy.mjs → src-CADYcyVw.mjs} +400 -400
  118. package/dist/{src-B5PnzP5L.mjs → src-DI-4tHhA.mjs} +2 -2
  119. package/dist/src-DKJ4ztC7.mjs +1 -0
  120. package/dist/{start-D6zGIr_Q.mjs → start-BjlDf_Bu.mjs} +3 -3
  121. package/dist/start-Dbcx2ERQ.mjs +1 -0
  122. package/package.json +4 -4
  123. package/dist/constants-C7GcNmeI.mjs +0 -2
  124. package/dist/git-handle-CxBV0Wpn.mjs +0 -1
  125. package/dist/init-JcBDV_oY.mjs +0 -1
  126. package/dist/loader-B56L22Gi.mjs +0 -1
  127. package/dist/md-manager-BZ9HvsZ5.mjs +0 -2
  128. package/dist/preview-CD2IbfNk.mjs +0 -1
  129. package/dist/public/assets/DocumentContext-BAge_zSA.js +0 -38
  130. package/dist/public/assets/FeedbackForm-zVLbVP8X.js +0 -1
  131. package/dist/public/assets/ManagedArtifactProperties-BLA-YQZP.js +0 -1
  132. package/dist/public/assets/SessionsHost-DDc_pyiu.js +0 -2
  133. package/dist/public/assets/globals-DG05ucI2.css +0 -1
  134. package/dist/public/assets/i18n-DxXpBJoo.js +0 -1
  135. package/dist/public/assets/index-BxqdFknQ.js +0 -2196
  136. package/dist/public/assets/page-list-cache-DJODoSOh.js +0 -1
  137. package/dist/public/assets/thread-client-BpWutFry.js +0 -1
  138. package/dist/repair-skills-BKbFH2b2.mjs +0 -1
  139. package/dist/server-lock-CyzgE09K.mjs +0 -1
  140. package/dist/src-CNBY5GiX.mjs +0 -20
  141. package/dist/src-Db2adcph.mjs +0 -1
  142. package/dist/src-qYDMEf4S.mjs +0 -1
  143. package/dist/start-D8D6GD4Q.mjs +0 -1
  144. /package/dist/public/assets/{globals-CuEz5zF0.js → globals-DWxOaSHQ.js} +0 -0
package/README.md CHANGED
@@ -24,7 +24,7 @@ ok start # serve the editor and open it in your browser
24
24
 
25
25
  - `ok init` — turn a folder into an OpenKnowledge project and register the MCP server with supported AI tools.
26
26
  - `ok start` — run the local server and web editor, then open it in your browser.
27
- - `ok open <file.md>` — open a single Markdown file in the editor.
27
+ - `ok open <target>` — open a doc, a folder, or a path to a Markdown file in the editor. It prints the project root it resolved; pass `--project <dir>` anywhere in the command to name one yourself.
28
28
  - `ok --help` — list every command.
29
29
 
30
30
  ## Desktop app
@@ -1,7 +1,7 @@
1
- import{pt as e}from"./sleep-BZo73vVn.mjs";import{Ri as t}from"./src-DifwZnFy.mjs";import{F as n,M as r,N as i}from"./fs-traced-Cu6kXy54.mjs";import{b as a,g as o,m as s,p as c,s as l}from"./resolve-project-root-BmEYZjtQ.mjs";import{S as ee,T as u,d as te,o as d,v as f,x as ne}from"./init-44bY7bDu.mjs";import{t as p}from"./is-object-Bw0-z8qH.mjs";import{execFileSync as m,spawn as h}from"node:child_process";import{basename as re,dirname as g,join as _,resolve as ie,win32 as v}from"node:path";import{existsSync as y,mkdirSync as b,readFileSync as x,readdirSync as ae,statSync as oe,writeFileSync as se}from"node:fs";import{homedir as S}from"node:os";var C=e();const w=`open-knowledge`;function T(e){try{e()}catch{}}var E=class{backend=`keyring`;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(w,e).getPassword()}catch(t){return T(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return T(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return T(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(w,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(w,e).deletePassword()}catch{}}},D=class{backend=`file`;authFile;constructor(e){this.authFile=e??_(S(),`.ok`,`auth.yml`)}read(){if(!y(this.authFile))return{};try{return(0,C.parse)(x(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=g(this.authFile);y(t)||b(t,{recursive:!0,mode:448}),se(this.authFile,(0,C.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},ce=class{backend=`keyring`;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ~/.ok/auth.yml to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function O(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(w,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
1
+ import{pt as e}from"./sleep-BZo73vVn.mjs";import{Bi as t}from"./src-CADYcyVw.mjs";import{F as n,M as r,N as i}from"./fs-traced-Cu6kXy54.mjs";import{b as a,g as o,m as s,p as c,s as l}from"./resolve-project-root-C8lkeQRG.mjs";import{S as ee,T as u,d as te,o as d,v as f,x as ne}from"./init-DTAgv3R5.mjs";import{t as p}from"./is-object-Bw0-z8qH.mjs";import{execFileSync as m,spawn as h}from"node:child_process";import{basename as re,dirname as g,join as _,resolve as ie,win32 as v}from"node:path";import{existsSync as y,mkdirSync as b,readFileSync as x,readdirSync as ae,statSync as oe,writeFileSync as se}from"node:fs";import{homedir as S}from"node:os";var C=e();const w=`open-knowledge`;function T(e){try{e()}catch{}}var E=class{backend=`keyring`;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(w,e).getPassword()}catch(t){return T(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return T(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return T(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(w,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(w,e).deletePassword()}catch{}}},D=class{backend=`file`;authFile;constructor(e){this.authFile=e??_(S(),`.ok`,`auth.yml`)}read(){if(!y(this.authFile))return{};try{return(0,C.parse)(x(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=g(this.authFile);y(t)||b(t,{recursive:!0,mode:448}),se(this.authFile,(0,C.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},ce=class{backend=`keyring`;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ~/.ok/auth.yml to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function O(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(w,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
2
2
  `),T(()=>t?.onBackendSelected?.({backend:`keyring`})),new ce(new E(t?.onKeychainRead),new D(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (~/.ok/auth.yml) — OS keychain unavailable: ${r}\n`),T(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new D(e)}}function k(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (~/.ok/auth.yml)\n`),r(new D(e))},n)});try{return await Promise.race([O(e),r])}catch{return new D(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function le(e){let t=k(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token,login:n.login}}}}function ue(e){let t=k(e);return{backend:`file`,async get(e){return(await t()).get(e)},async set(e,n,r,i){return(await t()).set(e,n,r,i)},async clear(e){return(await t()).clear(e)}}}async function de(e,t){let n=[],r=new D(t);await r.get(e)!=null&&(await r.clear(e),n.push(`file`));let i;try{let{Entry:t}=await import(`@napi-rs/keyring`);new t(w,`__probe__`);let r,a=await new E(e=>{e.kind===`read-error`&&(r=e.error??`read-error`)}).get(e);if(r!==void 0)i=r;else if(a!=null)try{new t(w,e).deletePassword(),n.push(`keychain`)}catch(e){i=e instanceof Error?e.name:`delete-error`}}catch{}return{touched:n,keychainError:i}}const fe=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`],A={encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3,windowsHide:!0};function j(e,t={}){let{login:n}=t,r=t._exec??m,i=M(t._fileExists??y),a=e?[`--hostname`,e]:[];if(n){let e=N(r,i,[`auth`,`token`,...a,`--user`,n]);if(e)return{available:!0,token:e,resolvedLogin:n,fallback:!1}}let o=N(r,i,[`auth`,`token`,...a]);return o?n?{available:!0,token:o,fallback:!0}:{available:!0,token:o}:{available:!1}}function M(e){return[`gh`,...fe.filter(e)]}function N(e,t,n){for(let r of t)try{let t=e(r,n,A).toString().trim();if(t.length>0)return t}catch{}}function P(e,t={}){let n=t._exec??m,r=M(t._fileExists??y),i=[`auth`,`status`,...e?[`--hostname`,e]:[]],a=N(n,r,[...i,`--json`,`hosts`]);if(a!==void 0){let t=I(a,e);if(t)return t}let o=N(n,r,i);if(o!==void 0){let e=V(o);if(e.length>0)return e}}function F(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function I(e,t){let n;try{n=JSON.parse(e)}catch{return}let r=F(F(n)?.hosts);if(!r||t!==void 0&&r[t]===void 0)return;let i=t===void 0?Object.values(r):[r[t]],a=[];for(let e of i){if(!Array.isArray(e))return;for(let t of e){let e=F(t);if(!e)continue;let n=e.login;typeof n!=`string`||n.length===0||a.push({login:n,active:e.active===!0})}}return a}const L=/Logged in to \S+ account (\S+) \(/,R=/(?:Failed to log in to|Timeout trying to log in to) \S+/,z=/^\s*-\s*Active account:\s*true\s*$/,B=/\u001b\[[0-9;]*m/g;function V(e){let t=[],n;for(let r of e.split(`
3
3
  `)){let e=r.replace(B,``),i=L.exec(e)?.[1];if(i){n={login:i,active:!1},t.push(n);continue}if(R.test(e)){n=void 0;continue}n&&z.test(e)&&(n.active=!0)}return t}function pe(e){let t={...e};return delete t.ELECTRON_RUN_AS_NODE,t}function H(e){let t=e?.code;return t===`ENOENT`||t===`EACCES`||t===`EPERM`?{ok:!1,reason:`not-installed`}:{ok:!1,reason:`spawn-error`}}function U(e){return t({detached:!0,stdio:`ignore`,shell:!1,env:pe(e)})}function W(e,t,n={}){let r=(n.spawn??h)(e,[...t],U(n.env??process.env));return r.unref(),r}function me(e,t,n={}){let r=n.spawn??h,i=n.timeoutMs??2e3;return new Promise(a=>{let o=!1,s=e=>{o||(o=!0,a(e))},c=setTimeout(()=>s({ok:!1,reason:`timeout`}),i);try{let i=r(e,[...t],U(n.env??process.env));i.once(`error`,e=>{clearTimeout(c),s(H(e))}),i.once(`spawn`,()=>{clearTimeout(c),s({ok:!0})});try{i.unref()}catch{}}catch(e){clearTimeout(c),s(H(e))}})}const G=`com.inkeep.open-knowledge`,K=`OpenKnowledge.app`,q=`/Applications/${K}`;function he(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return oe(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function ge(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(J(e,q))return q;let t=_(e.homeDir??S(),`Applications`,K);return J(e,t)?t:null}function J(e,t){return Y(e,_(t,`Contents`,`MacOS`,`OpenKnowledge`))}function Y(e,t){try{let n=e.statSync(t);return n&&typeof n.isFile==`function`?n.isFile():!1}catch{return!1}}const _e=[`@inkeepopen-knowledge-desktop`,`OpenKnowledge`];function ve(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&/\\OpenKnowledge\.exe$/i.test(e.execPath))return e.execPath;let t=e.env.LOCALAPPDATA;if(t)for(let n of _e){let r=v.join(t,`Programs`,n,`OpenKnowledge.exe`);if(Y(e,r))return r}return null}function ye(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&e.execPath.endsWith(`/openknowledge`))return e.execPath;let t=`/opt/OpenKnowledge/openknowledge`;return Y(e,t)?t:null}function be(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`&&e.platform!==`win32`&&e.platform!==`linux`)return{available:!1,reason:`unsupported-platform`};let t;try{t=e.platform===`darwin`?ge(e):e.platform===`win32`?ve(e):ye(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:!(e.isTTY===!0||e.platform===`win32`&&e.isTTY===void 0&&!e.env.CI)||e.env.SSH_CONNECTION||e.env.SSH_TTY||e.platform===`linux`&&!e.env.DISPLAY&&!e.env.WAYLAND_DISPLAY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function xe(e,t){let n=e.log??(e=>console.error(e)),r=e.platform??process.platform;if(n("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)"),r===`darwin`){W(`open`,[`-b`,G],{spawn:e.spawn});return}let i=t?.bundlePath;if(!i){n(`Desktop launch skipped: no resolved desktop executable (caller bug).`);return}W(i,[],{spawn:e.spawn})}function Se(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found (checked the standard install locations for this OS). Install it from https://openknowledge.ai/download, or omit --mode for browser mode.`;case`darwin-only`:case`unsupported-platform`:return`Desktop app is not available on this platform. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect the desktop install (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available but launch dispatch did not fire (caller bug).`}}function X(e,t){let n=ie(e),r=t===void 0?a():a({home:t,env:{}});return{cwd:n,bridgePath:l.pi.projectConfigPath?.(n)??``,trustPath:_(r,`trust.json`)}}function Z(e,t,n){let r=d(l.pi,e,n,t);if(r.kind===`absent`)return{state:`absent`,text:null};if(r.kind!==`present`)return{state:`unreadable`,text:null};let i=r.entry,a=Array.isArray(i.args)&&typeof i.args[0]==`string`?i.args[0]:null;return s(i)?{state:`own-current`,text:a}:ee(i)?{state:`own-stale`,text:a}:{state:`foreign`,text:a}}function Q(e,t){let n;try{n=x(e,`utf-8`)}catch(e){let t=e.code;return t===`ENOENT`||t===`ENOTDIR`?{state:`untrusted`,entries:{},trailingNewline:!1}:{state:`unreadable`,entries:null,trailingNewline:!1}}if(n.trim()===``)return{state:`untrusted`,entries:{},trailingNewline:!1};let r;try{r=JSON.parse(n)}catch{return{state:`unreadable`,entries:null,trailingNewline:!1}}return p(r)?{state:r[t]===!0?`trusted`:`untrusted`,entries:r,trailingNewline:n.endsWith(`
4
4
  `)}:{state:`unreadable`,entries:null,trailingNewline:!1}}function Ce(e,t){let n=X(e,t),r=Z(n.cwd,n.bridgePath,t).state,i=Q(n.trustPath,n.cwd).state;return{...n,bridge:r,trust:i,bridgeLoadable:(r===`own-current`||r===`own-stale`)&&i===`trusted`,otherExtensions:$(n.bridgePath).names}}function $(e){let t=g(e),n=re(e);try{return{names:ae(t).filter(e=>e!==n&&e.endsWith(`.ts`)).sort(),verified:!0}}catch(e){let t=e.code;return{names:[],verified:t===`ENOENT`||t===`ENOTDIR`}}}async function we(e,t={mode:`published`},n){let r=X(e,n),i=Z(r.cwd,r.bridgePath,n);if(i.state===`foreign`)return{...r,ok:!1,bridge:`refused-foreign`,trust:`skipped`};if(i.state===`unreadable`)return{...r,ok:!1,bridge:`refused-unreadable`,trust:`skipped`};let a;if(i.state===`absent`)a=`written`;else{let e;try{e=ne(t)}catch{e=void 0}a=e!==void 0&&i.text===e?`unchanged`:`refreshed`}if(a!==`unchanged`){let e=f(l.pi,r.cwd,t,n,r.bridgePath);if(e.action!==`written`&&e.action!==`overwritten`)return{...r,ok:!1,bridge:`failed`,trust:`skipped`,error:e.error??`bridge write ${e.action}`}}let o=await Te(r.trustPath,r.cwd);return{...r,ok:o.action===`already-trusted`||o.action===`added`,bridge:a,trust:o.action,...o.error===void 0?{}:{error:o.error}}}async function Te(e,t){try{b(g(e),{recursive:!0})}catch(e){return{action:`failed`,error:e instanceof Error?e.message:String(e)}}let i={action:`added`};try{await r(`${e}.lock`,async()=>{let r=Q(e,t);if(r.state===`trusted`){i.action=`already-trusted`;return}if(r.entries===null){i.action=`refused-unreadable`;return}let a={...r.entries,[t]:!0},o=JSON.stringify(a,null,2)+(r.trailingNewline?`
5
5
  `:``),s=u(e);n(e,o,s===void 0?void 0:{mode:s}),i.action=`added`})}catch(e){return{action:`failed`,error:e instanceof Error?e.message:String(e)}}return i.action===`refused-unreadable`?{action:`refused-unreadable`,error:`trust store is not a readable JSON object`}:{action:i.action}}function Ee(e,t){let r=X(e,t),a=$(r.bridgePath);if(!a.verified)return{action:`kept-unverified`,error:`could not read the Pi extensions folder`};if(a.names.length>0)return{action:`kept-shared`};if(!y(r.trustPath))return{action:`not-present`};let o={action:`removed`};try{i(`${r.trustPath}.lock`,()=>{let e=Q(r.trustPath,r.cwd);if(e.entries===null){o.action=e.state===`unreadable`?`refused-unreadable`:`not-present`;return}if(!(r.cwd in e.entries)){o.action=`not-present`;return}let t={...e.entries};delete t[r.cwd];let i=JSON.stringify(t,null,2)+(e.trailingNewline?`
6
6
  `:``),a=u(r.trustPath);n(r.trustPath,i,a===void 0?void 0:{mode:a}),o.action=`removed`})}catch(e){return{action:`failed`,error:e instanceof Error?e.message:String(e)}}return o.action===`refused-unreadable`?{action:`refused-unreadable`,error:`trust store is not a readable JSON object`}:{action:o.action}}function De(e){return e===`opencode`?o:c}function Oe(e,t,n){let r=l[e],i=De(e),a=[],o=r.projectConfigPath?.(t);o!==void 0&&a.push({scope:`project`,configPath:o});try{a.push({scope:`user`,configPath:r.configPath(t,n)})}catch{}for(let o of a){let a=te(r,t,n,o.configPath);if(a!==null&&i(a))return{editorId:e,scope:o.scope,configPath:o.configPath}}return null}export{ue as _,G as a,xe as c,me as d,j as f,le as g,O as h,Ee as i,Se as l,de as m,we as n,he as o,P as p,Ce as r,be as s,Oe as t,W as u};
7
- //# sourceMappingURL=acp-harness-probe-DRbySBVr.mjs.map
7
+ //# sourceMappingURL=acp-harness-probe-ClLen5mV.mjs.map
@@ -112,9 +112,18 @@ If the OK MCP server isn't wired into this host there is no `preview_url` to
112
112
  call — use the `ok open` path above. Don't reconstruct what `preview_url` does
113
113
  by hand (spawning `ok mcp` yourself, scraping ports from `ok ps`).
114
114
 
115
- The path must be absolute (a file outside a project has no cwd to anchor a
116
- relative path). Re-opening the same file lands on the same session. Never
117
- construct or guess the URL — use the one `preview_url` returns.
115
+ Give an absolute path. `ok open` prints the absolute project root it resolved
116
+ for that path, and names the enclosing project too when the resolved root sits
117
+ inside another one. Read that line rather than assuming which project you got.
118
+
119
+ To name the project yourself, pass `--project <dir>`. It is honored wherever it
120
+ appears: `--project <dir>` or `--project=<dir>`, before or after the path, with
121
+ or without the `.md` extension. If it cannot be honored the command exits
122
+ non-zero and says why, so you never need a second command to find out where it
123
+ landed, and never need to stop a server to correct it.
124
+
125
+ Re-opening the same file lands on the same session. Never construct or guess the
126
+ URL — use the one `preview_url` returns.
118
127
 
119
128
  ## What else OK does
120
129
 
@@ -41,6 +41,7 @@ Decide once; then every "open / show / preview this doc" this session uses that
41
41
  - **`ok open <name>`** — opens a **doc or folder** in the OK Desktop app. The type is auto-detected (a directory on disk → folder, otherwise a doc), so **`--folder` is not needed** (it stays only as an explicit override for a folder that doesn't exist on disk yet). An action you run, not a URL to print.
42
42
  - **`ok open <skill-name> --skill [--scope project|global]`** — opens a **skill** in the skill editor (skills are addressed by name + scope, not a content path, so they need the flag).
43
43
  - All three deep-link into OK Desktop when a bundle is installed, and fall back to the browser UI (`ok start`) otherwise. No `ok` on PATH or no shell → `preview_url`, then `open <url>` in the system browser as a last resort, and say so plainly. The system browser is the fallback, never the default.
44
+ - **`ok open` prints the absolute project root it resolved**, and names the enclosing project too when that root sits inside another one. Read that line instead of assuming which project you got. To name the project yourself, pass `--project <dir>`; it is honored wherever it appears (`--project <dir>` or `--project=<dir>`, before or after the target, with or without a `.md` extension), or the command exits non-zero saying why.
44
45
 
45
46
  (The same vendors' *desktop apps* with a built-in browser — Cursor, Codex desktop — are NOT here; they navigate their own browser per the in-app branch above. Codex **IDE extension** / **Cloud** are web-search-only → they're on this CLI track too.) **Running inside OpenKnowledge itself — the desktop built-in terminal (`OK_DESKTOP_TERMINAL`) or the in-app agent panel (`OK_HOSTED_AGENT`)? Same track — `ok open <name>` re-targets the surface you're already in** (switches it to the doc/folder; when that surface is a desktop window there's no second window, and no need to raise it since it's already frontmost). Don't resolve preview URLs in that case; `ok open` is the whole answer.
46
47
 
package/dist/cli.d.mts CHANGED
@@ -1,7 +1 @@
1
- import { Logger } from "pino";
2
-
3
- //#region src/cli.d.ts
4
- declare function getCliLogger(): Logger | undefined;
5
- //#endregion
6
- export { getCliLogger };
7
- //# sourceMappingURL=cli.d.mts.map
1
+ export { };